package com.rocketmq.listener;

import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @Author 派大星
 * @Description TODO
 * @Date 2025/7/31 16:45
 */
@Component
@RocketMQMessageListener(topic = "bootKeyTopic",
        consumerGroup = "boot-key-consumer-group"
)
public class DKeyMsgListener implements RocketMQListener<MessageExt> {

    @Override
    public void onMessage(MessageExt messageExt) {
        System.out.println("keys:" + messageExt.getKeys());
        System.out.println(new String(messageExt.getBody()));
    }
}
